package _1010.funcref;

import org.junit.Test;

public class ConstructorRefDemo {

	class Person{
		Person(){
			System.out.println(1);
		}
		Person(String name){
			System.out.println(2);
		}
		Person(String name,int age){
			System.out.println(3);
		}
	}
	
	interface Maker<T>{
//		T builder();
//		T builder(String name);
		T builder(String name,int age);
	}
	
	@Test
	public void t1() {
		Maker<Person> m = Person::new;
//		System.out.println(m.builder());  // Person(String,int)
//		System.out.println(m.builder("zs"));  // Person(String,int)
		System.out.println(m.builder("zs",20));  // Person(String,int)
	}
}
